﻿using System.Windows.Controls;
using System.Windows.Input;


namespace GaleSong
{
    /// <summary>
    ///     Denotes an instance which can be executed.
    /// </summary>
    public interface IExecutable
    {
        bool CanExecute { get; }
        void Execute();
    }

    /// <summary>
    ///     Denotes an instance which can be checked.
    /// </summary>
    public interface ICheckable
    {
        bool IsCheckable { get; }
        bool IsChecked { get; set; }
    }

    /// <summary>
    ///     Denotes a small UI widget that can display and interact.
    /// </summary>
    public interface IPart : IView, IExecutable
    {
        string InputGestureText { get; set; }

        ICommand Command { get; }

        string Icon { get; set; }

        bool IsVisible { get; set; }

        IObservableCollection<IPart> Items { get; }

        void OnAttached();
    }

    /// <summary>
    ///     Concrete <see cref="IPart" /> which denotes a <see cref="MenuItem" /> instance.
    /// </summary>
    public interface IMenuPart : IPart, ISeparaterPart, ICheckable
    {
        KeyGesture KeyGesture { get; set; }
    }

    /// <summary>
    ///     Concrete <see cref="IPart" /> which denotes a <see cref="ToolBar" /> item instance.
    /// </summary>
    public interface IToolBarPart : IPart, ISeparaterPart
    {
        string ToolTip { get; set; }
        bool IsCheckable { get; set; }
    }

    /// <summary>
    ///     Denotes a <see cref="Separator" /> instance.
    /// </summary>
    public interface ISeparaterPart
    {
        bool IsSeparator { get; }
    }

    /// <summary>
    ///     Denotes a manager class that manage the <see cref="IPart" />s.
    /// </summary>
    public interface IPartManager<T> where T : IPart
    {
        T this[string name] { get; }

        IObservableCollection<T> Items { get; }
    }

    /// <summary>
    ///     Denotes a manager node that holds the <see cref="IObservableCollection{T}" /> item.
    /// </summary>
    public interface IObservableParent<T>
    {
        IObservableCollection<T> Items { get; }
    }
}